
#ifndef _RoleAssigner_H_
#define _RoleAssigner_H_

#include <map>
#include <list>

enum RoleType {
    ATTACKER_ROLE,
    DEFENDER_ROLE,
    MARAUDER_ROLE
};

class RoleAssigner {
  public:
    static RoleAssigner& instance(void);

    void updatePlayerRoleScores(unsigned player_id, std::map<RoleType, float> role_scores);
    RoleType getBestRole(unsigned player_id);

  private:

    std::map<unsigned, std::map<RoleType, float> > player_role_scores;
    std::map<unsigned, RoleType> role_assignment;


    void createNewPlayerMap(unsigned player_id);
    void recalculateRoles(void);
    std::list<unsigned> getOrderedRoleList(RoleType role_type);

    RoleAssigner();
    ~RoleAssigner();

};


#endif

